<%@page contentType="text/html;charset=UTF-8" language = "java"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
<html>
	<head>
		<title>编辑内容: <c:out value="${item.title}"/> | JWiki</title>
		<link rel="stylesheet" href="texts/style.css" type="text/css" />
		<script type="text/javascript" src="texts/nanoWIME.js"></script>
		<script type="text/javascript">
		/* <![CDATA[ */
		nanoWIME._init({
			// General options
			elementID : "wiki-editor",
			buttonBar1 : "h1,h2,h3,h4,h5,h6,|,ulist,olist,|,bold,italic,underline,strikethrough,sup,sub,nowiki,|,link_intern,link_extern",
			buttonsConf : {
				simple_ref : {
				title : 'Simple reference [s]',
				img : 'book_link.png',
				cssclass : 'button',
				align : 'middle',
				elementId : 'toolbar_btn_simpleref',
				on_mouseover : function() {
				this.className = 'raised';
				},
				on_mouseout : function() {
				this.className = 'button';
				},
				on_mousedown : function() {
				this.className = 'pressed'; 
				},
				on_mouseup : function() { 
				this.className = 'raised'; 
				},
				on_click : function() {
				var refName = prompt("Name of the reference:", "");
				var groupName = prompt("Name of thre group the reference belongs to:", "");
				var inString = "<ref";
				if (refName != '') {
					inString += ' name="' + refName + '"';
				} // if ENDE
				if (groupName != '') {
					inString += ' group="' + groupName + '"';
				} // if ENDE
				inString += '>';
				nanoWIME._getReplaceText(inString, '</ref>');
				},
				shortcut : 's'
			},
				ref_listing : {
				title : 'Reference listing [r]',
				img : 'table_link.png',
				cssclass : 'button',
				align : 'middle',
				elementId : 'toolbar_btn_reflisting',
				on_mouseover : function() {
				this.className = 'raised';
				},
				on_mouseout : function() {
				this.className = 'button';
				},
				on_mousedown : function() {
				this.className = 'pressed'; 
				},
				on_mouseup : function() { 
				this.className = 'raised'; 
				},
				on_click : function() {
				var groupName = prompt("Name of the group which will be listed:", "");
				var inString = '<references';
				if (groupName != '') {
					inString += ' group="' + groupName + '"';
				} // if ENDE
				inString += ' />';
				nanoWIME._getReplaceText(inString, '');
				},
				shortcut : 'r'
			}
			}
		});
		/* ]]> */
		</script>
		<script language = "javascript">
    	function checkform(){
    		if(edit_wiki.Username.value==""){
    			alert("用户名不能为空！");
    			edit_wiki.Username.focus();
    			return false;
    		}
    		if(edit_wiki.Username.value.length<1||edit_wiki.Username.value.length>20){
    			alert("用户名超出了范围（1~20）");
    			edit_wiki.Username.focus();
    			return false;
    		}
    		if(edit_wiki.Password.value==""){
    			alert("密码不能为空！");
    			edit_wiki.Password.focus();
    			return false;
    		}
    		if(edit_wiki.Password.value.length<1||edit_wiki.Password.value.length>10){
    			alert("密码超出了范围（1~10）");
    			edit_wiki.Password.focus();
    			return false;
    		}
    	}
    	</script>
	</head>
	<body>
		<div id="page-wrapper">
			<c:import url="header.jsp"/>
			<c:import url="sidebar.jsp"/>
			<div id="content">
				<c:import url="navs.jsp"/>
				<c:if test="${item.type == 2}">
					<h2><c:out value="${item.title}"/></h2>
				</c:if>
				<c:if test="${item.type == 1}">
					<h2>目录：<c:out value="${item.title}"/></h2>
				</c:if>
				<div id="wiki-edit">
				<form action="update.do" method="post">
				<input name = "revId" type = "hidden" value="<c:out value="${item.revId}"/>"/>
				<input name = "itemId" type = "hidden" value="<c:out value="${item.itemId}"/>"/>
				<textarea name="content" rows="30" cols="80" id="wiki-editor"><c:out value="${item.content}"/></textarea>
				<br />
				<input type = "submit" value = "提交更改" name = "submit"/>
				</form>
				</div>
				<p>请使用如下的Wiki语法：</p>
				<table><tbody><tr class="evn"><td> <strong>Wiki Markup</strong> </td><td> <strong>HTML</strong> </td></tr>
<tr class="odd"><td colspan="2"> <em>Block Formatting</em> </td></tr>
<tr class="odd"><td class="lft"><code>paragraphs separated</code><br>
 <br>
<code>by an empty line </code> </td><td class="lft"><code>&lt;p&gt;paragraphs separated&lt;/p&gt;</code><br>
<code>&lt;p&gt;by an empty line&lt;/p&gt;</code> </td></tr>
<tr class="evn"><td class="lft"><code>line break by two\\ </code><br>
<code>slashes followed by a space or newline</code> </td><td class="lft"><code>line break by two&lt;br/&gt;</code><br>
<code>slashes followed by a space or newline</code> </td></tr>
<tr class="odd"><td class="lft"><code>["quotation"]</code> </td><td class="lft"><code>&lt;blockquote&gt;&lt;p&gt;quote&lt;/p&gt;&lt;/blockquote&gt;</code> </td></tr>
<tr class="evn"><td class="lft"><code>[%code block</code>%] </td><td class="lft"><code>&lt;pre&gt;code block&lt;/pre&gt;</code> </td></tr>
<tr class="odd"><td colspan="2"> <em>Inline Formatting</em> </td></tr>
<tr class="evn"><td class="lft"><code>*strong*</code> </td><td class="lft"><code>&lt;strong&gt;strong&lt;/strong&gt;</code> </td></tr>
<tr class="odd"><td class="lft"><code>_emphasized_</code> </td><td class="lft"><code>&lt;em&gt;emphasized&lt;/em&gt;</code> </td></tr>
<tr class="evn"><td class="lft"><code>^superscript^</code> </td><td class="lft"><code>&lt;sup&gt;superscript&lt;/sup&gt;</code> </td></tr>
<tr class="odd"><td class="lft"><code>~subscript~</code> </td><td class="lft"><code>&lt;sub&gt;subscript&lt;/sub&gt;</code> </td></tr>
<tr class="evn"><td class="lft"><code>%code%</code> </td><td class="lft"><code>&lt;code&gt;code&lt;/code&gt;</code> </td></tr>
<tr class="odd"><td class="lft"><code>?ABBR(abbreviation)?</code> </td><td class="lft"><code>&lt;abbr title="abbreviation"&gt;ABBR&lt;/abbr&gt;</code> </td></tr>
<tr class="evn"><td colspan="2"> <em>Links &amp; Images</em> </td></tr>
<tr class="odd"><td class="lft"><code>http://u.ri</code> </td><td class="lft"><code>&lt;a href="http://u.ri"&gt;http://u.ri&lt;/a&gt;</code> </td></tr>
<tr class="evn"><td class="lft"><code>[http://u.ri, title]</code> </td><td class="lft"><code>&lt;a href="http://u.ri"&gt;title&lt;/a&gt;</code> </td></tr>
<tr class="odd"><td class="lft"><code>uri/image.png</code> </td><td class="lft"><code>&lt;img src="uri/image.png" alt="uri/image.png"/&gt;</code> </td></tr>
<tr class="evn"><td class="lft"><code>[img:uri/image.png,title]</code> </td><td class="lft"><code>&lt;a href="http://u.ri"&gt;title&lt;/a&gt;</code> </td></tr>
<tr class="odd"><td class="lft"><code>[http://u.ri, title]</code> </td><td class="lft"><code>&lt;img src="uri/image.png" alt="title" title="title"/&gt;</code> </td></tr>
<tr class="evn"><td colspan="2"> <em>Lists</em> </td></tr>
<tr class="odd"><td class="lft"><code>; term: definition</code> </td><td class="lft"><code>&lt;dl&gt;&lt;dt&gt;term&lt;/dt&gt;&lt;dd&gt;definition&lt;/dd&gt;&lt;/dl&gt;</code> </td></tr>
<tr class="evn"><td colspan="2"> <em>Table</em> </td></tr>
<tr class="odd"><td class="lft"><code>[|one|two|</code><br>
<code> ||three|four|]</code> </td><td class="lft"><code>&lt;table&gt;&lt;tr&gt;&lt;td&gt;one&lt;/td&gt;&lt;td&gt;two&lt;/td&gt;&lt;/tr&gt;</code><br>
<code>&lt;tr&gt;&lt;td&gt;three&lt;/td&gt;&lt;td&gt;four&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</code> </td></tr></tbody></table>
				
			</div>
			<c:import url="footer.jsp"/>			
		</div>
	</body>
</html>